import ReCAPTCHA from 'react-google-recaptcha'
import React from 'react'

const RECAPTCHA_SITE_KEY = '6Ldgi-gpAAAAAGyVy35hu5ZgvKP1UjfMpsxnYf_2' // 替换为你自己的 reCAPTCHA 站点密钥

export const Recaptcha: React.FC = ({ onChange }) => {
  const handleRecaptchaChange = (token: string) => {
    onChange(token)
  }

  return (
    <div>
      <ReCAPTCHA
        sitekey={RECAPTCHA_SITE_KEY}
        onChange={handleRecaptchaChange}
      />
    </div>
  )
}

export default Recaptcha
